<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ice="http://www.icesoft.com/icefaces/component"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:composite="http://java.sun.com/jsf/composite"
      xmlns:ace="http://www.icefaces.org/icefaces/components"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

    <composite:interface>
        <composite:attribute name="rendered" required="true"/>        
    </composite:interface>

    <composite:implementation>

        <ice:panelPopup rendered="#{questionRechercheController.popupVisible}" draggable="true" style="z-index: 1000; top: 30%; left: 10%; position: absolute; width: 500px;height: 200px">
            <f:facet name="header">
                <ice:panelGrid width="100%" cellpadding="0" cellspacing="0" columns="2" style="text-align: center;cursor:move;width: 500px;">
                    <ice:outputText style="color: #FF0000;" value="Rechercher une question"/><!--cc.attrs.actionFermerPopup-->
                    <ice:commandButton image="/images/popupclose.gif" action="#{questionRechercheController.closePopup}" title="Close this draggable popup"/>
                </ice:panelGrid>
            </f:facet>

            <f:facet name="body">
                <ice:panelGrid width="100%" cellpadding="0" cellspacing="0">

                    <ice:panelGrid columns="3">
                        <ice:outputLabel value="Titre d'une question : "/>
                        <ice:inputText value="#{questionRechercheController.rechercheLibelleQuestion}"/>
                        <ice:commandButton action="#{questionRechercheController.rechercherQuestion}" value="Rechercher" />
                    </ice:panelGrid>

                    <br/>
                    <ice:outputLabel value="Aucun résultats." style="color: #FF0000;"
                                     rendered="#{questionRechercheController.resultatVide}"/>

                    <!--pour afficher les questions -->
                    <!--value="#{questionRechercheController.listRechercheQuestion}"
                    value="#{questionRechercheController.dataModelListQuestion}"-->
                    <ice:dataTable
                        id="resultatQuestion"
                        var="question" styleClass="positionPanelContainer"
                        value="#{questionRechercheController.dataModelListQuestion}"
                        scrollable="true"
                        columnWidths="270px,30px"
                        scrollHeight="100px"
                        rendered="#{!questionRechercheController.resultatVide}"                        
                        >

                        <ice:column style="padding-right: 285px;">
                            <!--<ice:panelGroup panelTooltip="pnlSerPanelToolTip">-->
                                <ice:commandLink action="#{questionRechercheController.chargerListReponse2}">
                                    <ice:outputLabel value="#{question.libelle}"/>
                                    <f:setPropertyActionListener target="#{questionRechercheController.questionSelected}"
                                                                 value="#{question}"/>
                                </ice:commandLink>
                            <!--</ice:panelGroup>-->


                            <!--panel qui affiche les réponses de la questions-->
                            <!--displayListener="#{questionRechercheController.chargerListReponse}"

                            hoverDelay="1000"-->


                           











                        </ice:column>

                        <ice:column>
                            <ice:commandButton style="float: right" image="/resources/images/icone_ajouter.png" alt="Ajouter la question"
                                               action="#{questionRechercheController.ajouterAuQuestionnaire}" value="Suppr">
                                <f:setPropertyActionListener target="#{questionRechercheController.questionRechercher}" value="#{question}" />
                            </ice:commandButton>
                        </ice:column>

                    </ice:dataTable>

                </ice:panelGrid>

            </f:facet>
        </ice:panelPopup>





















        <ice:panelPopup rendered="#{questionRechercheController.afficherReponse}" draggable="true"
                        modal="false" style="width:250px;height:150px;">
            <f:facet name="header">
                <ice:panelGrid width="100%" cellpadding="0" cellspacing="0" columns="2" style="text-align: center;cursor:move;width: 250px;">
                    <ice:outputText style="color: #FF0000;" value="#{questionRechercheController.questionSelected.libelle}"/>
                    <ice:commandButton image="/images/popupclose.gif" action="#{questionRechercheController.closePopup2}" title="Close this draggable popup"/>
                </ice:panelGrid>
            </f:facet>
            
            <f:facet name="body">
                <h:panelGrid width="100%" cellpadding="0" cellspacing="0" >




                    <ice:dataTable
                        id="resultatReponse"
                        var="reponse" styleClass="positionPanelContainer"
                        value="#{questionRechercheController.listReponse}"
                        scrollable="true"
                        columnWidths="150px"
                        scrollHeight="75px">
                        <ice:column>
                           <ice:outputLabel value="#{reponse.libelle}"/>                            
                        </ice:column>
                    </ice:dataTable>
                </h:panelGrid>
            </f:facet>            
        </ice:panelPopup>


<!--value="#{question.reponseCollection}"
                    value="#{questionRechercheController.listReponse}"
                    value="#{questionRechercheController.dataModelListReponse}"-->














    </composite:implementation>
</html>